//index.js
//获取应用实例
const app = getApp()
Page({
  data: {
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
  },
  onLoad: function () {
    
  },
  getUserInfo: function (e) {
    if (e.detail.userInfo) {
      app.userInfo = e.detail.userInfo;
      wx.reLaunch({
        url: '/pages/index/index',
      })
    } else {
      wx.showModal({
        title: '警告',
        content: '您点击了拒绝授权，将无法进入小程序，请选择授权',
        showCancel: false,
        confirmText: '返回授权',
        success: function (res) {
          
        }
      });
    }
  }
})
